Skip to content

Conversation

@sonianand11
Copy link
Contributor

This PR includes

  • use of present? method in is_requesting? method of worker
  • modify check for requesting in worker spec returns true if there is a current batch

@benjaminhoffman

Note : Intention of this PR is to re run test in travis

Copy link

@nettofarah nettofarah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
It might be worth adding a comment to that test and explaining the possible race condition we were running into before these changes

#
def is_requesting?
@lock.synchronize { !@batch.empty? }
@lock.synchronize { @batch.present? }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this relies on activesupport, which is a dependency you usually don't want to have in more generic gems.
We might wanna change this to use any?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I used it as we already have it in our gemspec.

end
end

res = Request.new.post @write_key, @batch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to remove this whitespace

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant *new line.

end

it 'returns true if there is a current batch' do

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to add this extra line

@sonianand11 sonianand11 reopened this Apr 13, 2017
@sonianand11 sonianand11 reopened this Apr 13, 2017
@benjaminhoffman benjaminhoffman merged commit cfb13b7 into segmentio:master Apr 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants